package demo2;
//Test.java
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException{
        Book book1=new Book();
        Book book2=(Book) book1.clone();
        System.out.println("修改前"+book1.writer.author);
        System.out.println("修改前"+book2.writer.author);
        book1.writer.author="李四";
        System.out.println("修改后"+book1.writer.author);
        System.out.println("修改后"+book2.writer.author);
    }
}
